package com.etlmaster.rowprocessor.core;

import java.util.Map;

import com.etlmaster.executor.trans.core.Line;
import com.etlmaster.rowprocessor.disruptor.readEvent.LineEvent;

/**
 * @author Larry
 * @copyright Larry@etlMaster
 * @since 2017-09-10
 */
public abstract class AbstractErrorPlugin extends AbstractPlugin implements AbstractInputPlugin{

	public AbstractErrorPlugin(String id, String jobId, String name,
			String code, Map<String, Object> paramMap,
			Map<String, Object> variables) {
		super(id, jobId, name, code, paramMap, variables);
		// TODO Auto-generated constructor stub
	}

	public abstract void onError(Line line);
	
	@Override
	public void onEvent(LineEvent event, long sequence, boolean endOfBatch)
			throws Exception {
		this.setCounter(sequence);

		onError(event.getValue());
		
	}

}
